﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="cardset.aspx.cs" Inherits="weikeweixin.web.admin.vip.cardset" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/bootstrap.min.css"
        media="all" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/bootstrap.responsive.min.css"
        media="all" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/style.css"
        media="all" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/todc_bootstrap.css"
        media="all" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/themes.css"
        media="all" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/inside.css"
        media="all" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/chosen.css"
        media="all" />
    <link rel="stylesheet" type="text/css" href="/css/Bootstrap/setcard.css"
        media="all" />
    <script type="text/javascript" src="/Scripts/JQuery.min.js"></script>
    <script type="text/javascript" src="/Scripts/JQuery.cookie.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.ui.widget.min.js"></script>
    <script src="../../../Scripts/JQuery.form.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/JQuery.form.wizard.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="/Scripts/Bootstrap.min.js"></script>
    <script type="text/javascript" src="/Scripts/JQuery.validate.min.js"></script>
    <script type="text/javascript" src="/Scripts/JQuery.validate.methods.js"></script>
    <script type="text/javascript" src="/Scripts/JQuery.Chosen.min.js"></script>
    <script type="text/javascript" src="/Scripts/JScolor.js"></script>
    <script type="text/javascript" src="/Scripts/Baidu.map.js"></script>
    <script type="text/javascript" src="/Scripts/Inside.js"></script>
    <!--上传文件--> 
      <script src="/Scripts/AjaxUpload.3.5.js" type="text/javascript"></script>
    
    <title>IdeaSoft软件</title>
    <!--[if lte IE 9]><script src="../../../scripts/watermark.js"></script><![endif]-->
    <!--[if IE 7]><link href="../../../css/bootstrap/font_awesome_ie7.css" rel="stylesheet" /><![endif]-->
</head>
<body>
    <script>
        $(document).ready(function () {
        
            $("#cname").change(function () {
                $("div.mc-name").text($(this).val())
            });
            $("#cname_color").change(function () {
                $("div.mc-name").css("color", $(this).val())
            });
            $("#numbercolor").change(function () {
                $("div.mc-number").css("color", $(this).val())
            });
            $("#select_bg").change(function () {

                var v = $(this).val();
                if (v.length > 0) {
                    $("img.i-img").attr("src", v)
                    $("#card_bg").val(v);
                }
            });
        });
    </script>
    <div class="container-fluid" id="Div1">
        <div id="Div2">
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="span12">
                        <div class="box">
                            <div class="box-title">
                                <div class="span10">
                                    <h3>
                                        <i class="icon-edit"></i>会员卡设置</h3>
                                </div>
                            </div>
                            <div class="box-content">
                                <form action="cardset.aspx" method="POST" class='form-horizontal form-validate'>
                                <input type="hidden" name="action" value="bindcardconfig" />
                                <div class="span12">
                                    <div class="img-preview">
                                        <div class="img-wrapper">
                                            <img class="i-img" id="cardbackg" src="<%=cardset_bgpic %>" />
                                            <div class="mc-name" style="color: <%=cardset_namecolor %>">
                                                <%=cardset_name%></div>
                                            <div class="mc-number" style="color: <%=cardset_codecolor %>">
                                                <em>会员卡号</em>88888</div>
                                        </div>
                                        <div>
                                            <ul class="nav nav-tabs nav-stacked">
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="span5">
                                        <div class="control-group">
                                            <label class="control-label">
                                                会员卡名称</label>
                                            <div class="controls inline">
                                                <input type="text" name="cardset_name" id="cname" value="<%=cardset_name %>" class="input-medium">
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">
                                                会员卡名称颜色</label>
                                            <div class="controls inline">
                                                <input type="text" name="cardset_namecolor" id="cname_color" value="<%=cardset_namecolor %>"
                                                    class="input-mini color">
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label">
                                                会员卡的背景</label>
                                            <div class="controls">
                                                <select name="cardset_bgpic1" id="select_bg" class="input-large" style="width: 227px">
                                                    <option selected="" value="<%=cardset_bgpic %>">请选择会员卡背景图</option>
                                                    <option value="../all/images/0618587298.png">01 </option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label for="textfield" class="control-label">
                                                自己设计背景
                                            </label>
                                            <div class="controls">
                                                <div class="input-append">
                                                    <input id="card_bg" name="cardset_bgpic" type="hidden" value="<%=cardset_bgpic %>"
                                                        class="input-large">
                                                    <button type="button" class="btn insertimage" 
                                                        rel="i-img" id="insert_bg">
                                                        选择背景</button>
                                                </div>
                                                <span class="help-block">建议尺寸：534像素 * 318像素</span>
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label for="textfield" class="control-label">
                                                卡号文字颜色
                                            </label>
                                            <div class="controls">
                                                <input type="text" name="cardset_codecolor" id="numbercolor" value="<%=cardset_codecolor %>"
                                                    class="input-mini color">
                                            </div>
                                        </div>

                                       <div class="control-group">
                                            <label for="lianjie" class="control-label">
                                                会员卡前台链接
                                            </label>
                                            <div class="controls" style="padding: 7px;">
                                                <a id="lianjie" target="_blank" href="http://<%=Url %>">http://<%=Url %></a>
                                                
                                                <span>将此链接拷贝到需要的地方</span>
                                            </div>
                                        </div>
                                    </div>
                                    <script type="text/javascript">
                                        function dodelit(i) {
                                            document.getElementById("txt" + i).value = "";
                                            document.getElementById("value" + i).value = "";
                                            if (i != 1) {
                                                document.getElementById("trtxt" + i).style.display = "none";
                                                document.getElementById("add" + i).style.display = "";
                                            }
                                        }
                                        function doaddit(i) {
                                            document.getElementById('trtxt' + i).style.display = "";
                                            document.getElementById('add' + i).style.display = "none";
                                        }
                                        function sdodelit(i) {
                                            document.getElementById("select" + i).value = "";
                                            document.getElementById("svalue" + i).value = "";
                                            if (i != 1) {
                                                document.getElementById("strtxt" + i).style.display = "none";
                                                document.getElementById("sadd" + i).style.display = "";
                                            }
                                        }
                                        function sdoaddit(i) {
                                            document.getElementById('strtxt' + i).style.display = "";
                                            document.getElementById('sadd' + i).style.display = "none";
                                        }
                                    </script>
                                </div>
                                <div class="form-actions" style="">
                                    <button id="Button1" type="submit"style="margin-top: 100px;" data-loading-text="提交中..." class="btn btn-primary">
                                        保存</button>
                                    <button type="button" class="btn" style="margin-top: 100px;" onclick="Javascript:window.history.go(-1);">
                                        取消</button>
                                </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    new AjaxUpload($("#insert_bg"), {
        action: '/Controllers/Ashx/UploadFile.ashx?p=cardget&dir=image',
        name: 'imgFile',
        onSubmit: function (file, ext) {
            if (!(ext && /^(jpg|png|jpeg|gif)$/.test(ext))) {
                $.messager.alert('错误提示', '只能上传 JPG, PNG 或 GIF 类型的文件！', 'info');
                return false;
            }
        },
        onComplete: function (file, response) {
            response = eval("(" + response + ")");
            if (response.error != "0") {
                alert(response.message);
            } else {
                document.getElementById("cardbackg").setAttribute("src", response.url);
                document.getElementById("card_bg").setAttribute("value", response.url);
            }
        }
    });
</script>